package com.designpattern.behave.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author chengze
 * @date 2022/12/3
 * @desc 调用者
 */
public class User {
    
    private List<Command> list = new ArrayList();

    public void  addCommand(Command command){
        list.add(command);
    }

    public void excuteCommand(){
        for (Command command:list) {
            command.command();
        }
    }
}
